/**
 * @author Juko
 * Активити для выбора темы во всем приложении
 */
package ganga.custodian.settings;

import ganga.custodian.CustodianApplication;
import ganga.custodian.R;
import ganga.custodian.utils.Theme;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;

public class ThemsActivity extends Activity {
	private CustodianApplication application;
	private Theme selectTheme;
	
	@Override
	protected void onResume() {
			super.onResume();
			setCurrentTheme();
			
	}
	
	   @Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.themsactivity);
		application = CustodianApplication.getInstance();
		selectTheme = application.selectTheme;
		setCurrentTheme();		
	}	
	
	public void custome_click(View v){	
		application = CustodianApplication.getInstance();
		selectTheme = application.selectTheme;
		selectTheme.setStyle(1);
		setCurrentTheme();		
	}

	private void setCurrentTheme() {
		LinearLayout themeLayout = (LinearLayout) findViewById(R.id.themelayout);
		themeLayout.setBackgroundColor(selectTheme.backGround);
	}
	
	public void default_click(View v){
		application = CustodianApplication.getInstance();
		selectTheme = application.selectTheme;
		selectTheme.setStyle(0);
		setCurrentTheme();					
	}

}
